/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm_candidatos;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class CandidatosDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression id_candidato;
	public final StringExpression nombre;
	public final StringExpression run;
	public final IntegerExpression votos;
	
	public CandidatosDetachedCriteria() {
		super(orm_candidatos.Candidatos.class, orm_candidatos.CandidatosCriteria.class);
		id_candidato = new IntegerExpression("id_candidato", this.getDetachedCriteria());
		nombre = new StringExpression("nombre", this.getDetachedCriteria());
		run = new StringExpression("run", this.getDetachedCriteria());
		votos = new IntegerExpression("votos", this.getDetachedCriteria());
	}
	
	public CandidatosDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm_candidatos.CandidatosCriteria.class);
		id_candidato = new IntegerExpression("id_candidato", this.getDetachedCriteria());
		nombre = new StringExpression("nombre", this.getDetachedCriteria());
		run = new StringExpression("run", this.getDetachedCriteria());
		votos = new IntegerExpression("votos", this.getDetachedCriteria());
	}
	
	public Candidatos uniqueCandidatos(PersistentSession session) {
		return (Candidatos) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Candidatos[] listCandidatos(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Candidatos[]) list.toArray(new Candidatos[list.size()]);
	}
}

